namespace CSharpPro._1009;
//1009
public class Demo
{ 
    public void TestPrint2()
    {
        for (int i = 100; i < 1000; i++)
        {
            int a = i / 100;
            int b = (i-a*100) / 10;
            int c = i % 10;
            if (i == a * a * a + b * b * b + c * c * c)
            {
                Console.Write(i + "\t");
            }
        }
    }

    public void TestPrint3()
    {
        for (int i = 2; i < 100; i++)
        {
            bool isPrime = true;
            for (int j = 2; j*j <= i; j++)
            {
                if (i % j == 0)
                {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime)
            {
                Console.Write(i + "\t");
            }
        }
    }
}